<extend name="Layout/base" />
<block name="css">
	<style>
		.el-main {
			padding: 0 20px;
			border: 1px solid #ccc;
			height: 100%;
		}
		.el-form {
			background: #fff;
			margin-top: 20px;
			padding-bottom: 20px;
		}
		.project {
			display: flex;
			border-bottom: 1px solid #ccc;
			padding-top: 20px;
		}
		.loginfo {
			display: flex;
			padding-top: 20px;
		}
		.title {
			font-size: 20px;
			margin-left: 20px;
		}
		.vertify {
			display: flex;
		}
		.getcode {
			height: 30px;
			line-height: 30px;
			border: 1px solid #ccc;
			margin-left: 20px;
			padding: 0 10px;
			border-radius: 4px;
		}
		.select {
			margin-left: 30px;
			margin-bottom: 20px;
		}
		.btns {
			margin-top: 60px;
		}
	</style>
</block>
<block name="content">
	<el-form ref="form" :model="param" label-width="110px">
		<div class="project">
			<div class="title">账号类型</div>
			<div class="select">
				<el-select v-model="param.status" placeholder="请选择">
					<el-option label="超级管理员" value="1"></el-option>
					<el-option label="项目负责人" value="3"></el-option>
					<el-option label="财务人员" value="2"></el-option>
				</el-select>
			</div>
		</div>
		<div class="loginfo">
			<div class="title">登录信息</div>
			<div>
				<el-form-item label="用户名">
					<el-input v-model="param.username" placeholder="请输入"></el-input>
				</el-form-item>
				<el-form-item label="昵称">
					<el-input v-model="param.nickname" placeholder="请输入"></el-input>
				</el-form-item>
				<!--<el-form-item label="登录手机">-->
					<!--<el-input v-model="form.mobile" placeholder="请输入"></el-input>-->
				<!--</el-form-item>-->
				<!--<div class="vertify">-->
					<!--<el-form-item label="验证码">-->
						<!--<el-input v-model="form.vercode" placeholder="请输入"></el-input>-->
					<!--</el-form-item>-->
					<!--<div class="getcode">获取验证码</div>-->
				<!--</div>-->
				<el-form-item label="登录密码">
					<el-input v-model="param.password" show-password placeholder="请输入"></el-input>
				</el-form-item>
			</div>
		</div>
		<div class="btns">
			<el-form-item>
				<el-button type="primary" @click="add">创建账号</el-button>
				<el-button>取消</el-button>
			</el-form-item>
		</div>
	</el-form>
</block>
<block name="js">
	<script>
        new Vue({
            el: '#app',
            data: function() {
                return {
                    param: {

					}
                }
            },
            beforeCreate() {
            },
            methods: {
                add() {
                    var _this = this;
                    $.post(HOME_URL + '/orderAdmin/Admin/add', _this.param, function (data) {
                        if(data.status){
                            _this.$message({
                                type: 'success',
                                message: '添加成功'
                            });
                            setTimeout(function () {
                                location.href = HOME_URL + "/orderAdmin/Admin/index";
                            }, 1000);
                        }else{
                            _this.$message.error(data.msg);
                        }
                    }, 'json');
                }
            }
        });
	</script>
</block>